<div class="layui-container">
<blockquote class="layui-elem-quote" style="border-left-color: #f00;background-color: #fff;">污橘表白墙</blockquote>

<div class="panel panel-primary" style="border: #dd514c 1px solid;">
	<div class="panel-heading" style="background-color:#dd514c;border: #dd514c 1px solid;">
  <a href="./" class="btn" style="color:#888">
    <i class="layui-icon" style="color: #fff">&#xe65a;</i>  
  </a>
  发布表白</div>
	<div class="panel-body">
		<input type="text" id="name1" placeholder="请输入姓名" class="form-control" value="<?=@$_COOKIE['name1']?>"><br>
		<input type="text" id="name2" placeholder="请输入姓名" class="form-control" value="<?=@$_COOKIE['name2']?>"><br>
		<textarea id="info" placeholder="请输入内容" class="layui-textarea"><?=@$_COOKIE['info']?></textarea><br>
		<center><button class="layui-btn" style="background-color:#dd514c" id="ok"><i class="layui-icon">&#xe61f;</i>  立即提交</button></center>
	</div>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/layer/layer.js"></script>
<script>
  $("#ok").click(function(){
  //判断一下下
    $.post("api.php?s=add",
    {
        name1: $("#name1").val(),
        name2: $("#name2").val(),
        info: $('#info').val()
    },
    	function(data){
    		var json = JSON.parse(data);
          	layer.alert(json['msg']);
    	});
	});
</script>
</body>
</html>